libxen: fix a problem preventing use of xen_event_register().
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 3 Mar 2009 11:41:15 +0000 (11:41 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 3 Mar 2009 11:41:15 +0000 (11:41 +0000)
The conversion of input parameter xen_string_set to XML format creates
a XML "struct" tag instead of "array". The patch sets the XML tag for
SET now to "array".

Signed-off-by: Lutz Dube <Lutz.Dube@fujitsu-siemens.com>
tools/libxen/src/xen_common.c

index 10dd156e94612a28ba2433da6c26eb0e573deae9..f9da7127410f3983eb4128e4ca86b79541e3fee4 100644 (file)
@@ -90,6 +90,8 @@ add_param(xmlNode *, const char *, const char *);
 static xmlNode *
 add_param_struct(xmlNode *);
 static xmlNode *
+add_param_array(xmlNode *);
+static xmlNode *
 add_struct_array(xmlNode *, const char *);
 static xmlNode *
 add_nested_struct(xmlNode *, const char *);
@@ -1292,7 +1294,7 @@ make_body_add_type(enum abstract_typename typename, abstract_value *v,
         const struct abstract_type *member_type = v->type->child;
         arbitrary_set *set_val = v->u.struct_val;
         abstract_value v;
-        xmlNode *data_node = add_param_struct(params_node);
+        xmlNode *data_node = add_param_array(params_node);
 
         for (size_t i = 0; i < set_val->size; i++)
         {
@@ -1611,6 +1613,16 @@ add_param_struct(xmlNode *params_node)
 }
 
 
+static xmlNode *
+add_param_array(xmlNode *params_node)
+{
+    xmlNode *param_node = add_container(params_node, "param");
+    xmlNode *value_node = add_container(param_node,  "value");
+
+    return xmlNewChild(value_node, NULL, BAD_CAST "array", NULL);
+}
+
+
 static void
 add_struct_member(xmlNode *struct_node, const char *name, const char *type,
                   const char *value)